const fs = require('fs')
fs.readFile('./素材/成绩.txt', 'utf-8', function (err, datastr) {
    if (err) return console.log('文件读取失败' + err.message)
    const arr = datastr.split(' ')
    const arr1 = []
    arr.forEach(function (value, index) {
        arr1.push(value.replace('=', ':'))
    })
    console.log(arr1.join('\r\n'))
    const newstr = arr1.join('\r\n')

    fs.writeFile('./素材/成绩.txt', newstr, err => {
        if (err) return console.log('文件写入失败' + err.message)
        console.log('文件写入成功')
    })
})
